CALENDAR
Day of week, future date, past date, and number of days calculations.
----begin documentation----
Program:  CALENDAR
Author:   John P. Powers (jpp@cpdvax.csc.ti.com)
Date:     November 5, 1992

This program calculates day of week, the number of days between two
dates, and a past or future date.

Execute CALENDAR to begin the main program.  A menu is then
displayed:

  [ CMP | DATE1 | DATE2 | -DAYS | QUIT ]

Enter an early date into DATE1 and a later date into DATE2.  To enter
a date press <F2> or <F3>.  The calculator then prompts for a date. 
Type in the date in the MM.DDYYYY format.  For example, to enter
November 5, 1992, type 11.051992.

To calculate the number days between two dates, enter DATE1 and
DATE2, then press [CMP] [-DAYS].

To calculate a future date, enter DATE1 and the number of days. Press
<F4> to enter the number of days. The calculator then prompts for the
number of days.  Then press [CMP] [DATE2].  The future date is
displayed in the format MM.DDYYYY and the day of the week is
displayed.

To calculate a date in the past, enter DATE2 and the number of days,
then press [CMP] [DATE1].  The past date and day of the week is
displayed.

This program uses ACM algorithm 199.
----end documentation----
----begin ascii----
\START\
\COMMENT=Program file dated 11/05/92, 11:05
\NAME=CALENDAR
\FILE=calendar.85P
Lbl ENTER
Menu(1,"CMP",CMP,2,"DATE1",ED1,3,"DATE2",ED2,4,"\UC-Delta\DAYS",E\UC-Delta\\#\
D,5,"QUIT",QUIT)
Lbl ED1
CALenter:D\->\D1
D\->\W:CALday
Goto ENTER
Lbl ED2
CALenter:D\->\D2
D\->\W:CALday
Goto ENTER
Lbl E\UC-Delta\D
Input "\UC-Delta\Days: ",\UC-Delta\D
Goto ENTER
Lbl CMP
Menu(1,"ENTER",ENTER,2,"DATE1",CD1,3,"DATE2",CD2,4,"\UC-Delta\DAYS",C\UC-Delta\\#\
D,5,"QUIT",QUIT)
Lbl CD1
D2-\UC-Delta\D\->\D:D\->\D1
CALsplit
Goto ENTER
Lbl CD2
D1+\UC-Delta\D\->\D:D\->\D2
CALsplit
Goto ENTER
Lbl C\UC-Delta\D
D2-D1\->\\UC-Delta\D
Fix 0
Disp  \UC-Delta\D
Goto ENTER
Lbl QUIT
\STOP\
\START\
\COMMENT=Program file dated 11/05/92, 11:05
\NAME=CALday
\FILE=calday.85P
mod(W,7)\->\W
If  W==3:Disp "Sunday"
If  W==4:Disp "Monday"
If  W==5:Disp "Tuesday"
If  W==6:Disp "Wednesday"
If  W==0:Disp "Thursday"
If  W==1:Disp "Friday"
If  W==2:Disp "Saturday"
\STOP\
\START\
\COMMENT=Program file dated 11/05/92, 11:05
\NAME=CALenter
\FILE=calenter.85P
Input "Date: ",FD
iPart  FD\->\MM
iPart (100fPart  FD)\->\DD
\E\4fPart  100FD\->\YY
If  MM>2:Then
MM-3\->\MM
Else
MM+9\->\MM
YY-1\->\YY
End
iPart (YY/100)\->\C
YY-100C\->\YY
iPart (146097C/4)+iPart (1461YY/4)+iPart ((153MM+2)/5)+DD-578041\->\D
\STOP\
\START\
\COMMENT=Program file dated 11/05/92, 11:05
\NAME=CALsplit
\FILE=calsplit.85P
D\->\W
578041+D\->\D
iPart ((4D-1)/146097)\->\YY
4D-1-146097YY\->\D
iPart (D/4)\->\DD
iPart ((4DD+3)/1461)\->\D
4DD+3-1461D\->\DD
iPart ((DD+4)/4)\->\DD
iPart ((5DD-3)/153)\->\MM
5DD-3-153MM\->\DD
iPart ((DD+5)/5)\->\DD
100YY+D\->\YY
If  MM<10:Then
MM+3\->\MM
Else
MM-9\->\MM
YY+1\->\YY
End
(YY/\E\4+DD)/\E\2+MM\->\D
Fix 6
Disp  D
CALday
\STOP\
----end ascii----
----begin uue----
begin 644 calendar.85g
M*BI423@U*BH:#`!'<F]U<&5D(&9I;&4@9&%T960@,3$O,#4O.3(L(#$Q.C`T
M```0``T`"`#!!`P`P0$2"$-!3$5.1$%2P0&_`>!%3E1%4@!O3!!$,0`O+4--
M4``O-4--4"]$,@`O+41!5$4Q`"\U140Q+T0S`"\M1$%413(`+S5%1#(O1#0`
M+RV^1$%94P`O-46^1"]$-0`O+5%5250`+S9154E4$6_@140Q`&\Z0T%,96YT
M97)N,T0+-$0Q;S-$"S-7;CA#04QD87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